<?php


//  Hello!
// 
//    This script will send to your list each confirmed email address
//    Here's your TWO steps guide
//
//  FIRST:
//
//    Substitute the following TEST address with your
//    Real distribution List Managing Email Address 
//    (the same in SendBlaster Managing Subscription Section):
// ...please pay attention to the ' ' apostrophes, they must remain around the email address.



$emailmanager = 'suscripciones@webcedis.ok.pe';



//  SECOND:
//
//    SAVE this file and close. :)
//
//
//  OPTIONAL: 
//
//    These are the positive and negative reply pages URLs
//    You can leave them as they are for the moment.
//    (you can omit the full path or enter the full URL):


$urlok = 'confirm-ok.htm';
$urlko = 'confirm-ko.htm';



//
//    That's all!
//


error_reporting(0);
set_magic_quotes_runtime (0);
if (get_magic_quotes_gpc()) {
	foreach($_POST as $k=>$v)
		$_POST[$k] = stripslashes($v);
	foreach($_COOKIE as $k=>$v)
		$_COOKIE[$k] = stripslashes($v);
}

$msg = $_COOKIE['sb'.$_GET['id']];

$email = trim($_GET['email']);
$Ok = ereg("^([a-zA-Z0-9_\.-]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$", $email);

$headers  = 'Desde: ' . $email . "\n"; 
$headers .= 'MIME-Version: 1.0' ."\n"; 
$headers .= 'Content-Type: text/plain; charset=iso-8859-1' ."\n"; 
$headers .= 'Content-Transfer-Encoding: 8bit'. "\n\n";

if ($Ok && ($msg != '')) {
	mail($emailmanager,'Suscripcion WebCedis',$msg,$headers);
	Header("Location: $urlok");
} else {
	Header("Location: $urlko");
}
